import axios from '@/libs/api.request'

/**
 * 获取应用数据
 * @returns {wx.RequestTask | never}
 */
export const getList = (params) => {
  return axios.request({
    url: 'GameConfig/index',
    method: 'get',
    params: params
  })
}

export const del = (params) => {
  return axios.request({
    url: 'GameConfig/del',
    method: 'get',
    params: params
  })
}

/**
 * 新增应用
 * @param data
 * @returns {wx.RequestTask | never}
 */
export const add = (data) => {
  return axios.request({
    url: 'GameConfig/add',
    method: 'post',
    data
  })
}

/**
 * 导入配置
 * @param data
 * @returns {wx.RequestTask | never}
 */
export const importConf = (data) => {
  return axios.request({
    url: 'GameConfig/importConf',
    method: 'post',
    data
  })
}

/**
 * 绑定配置
 * @param data
 * @returns {wx.RequestTask | never}
 */
export const confirmConf = (data) => {
  return axios.request({
    url: 'GameConfig/confirmConf',
    method: 'post',
    data
  })
}

/**
 * 编辑应用
 * @param data
 * @returns {wx.RequestTask | never}
 */
export const edit = (data) => {
  return axios.request({
    url: 'GameConfig/edit',
    method: 'post',
    data
  })
}

/**
 * 同步配置
 * @param data
 * @returns {wx.RequestTask | never}
 */
export const updateConf = (data) => {
  return axios.request({
    url: 'GameConfig/updateConf',
    method: 'post',
    data
  })
}
